﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.ParaManagement
{
    /// <summary>
    /// 改变参数项
    /// </summary>
    public class ParaChangeItem
    {
        /// <summary>
        /// 参数名
        /// </summary>
        public string ParaName { get; private set; }

        /// <summary>
        /// 参数新值
        /// </summary>
        public object NewValue { get; private set; }

        /// <summary>
        /// 参数旧值
        /// </summary>
        public object OldValue { get; private set; }

        /// <summary>
        /// 构造函数-增加或移除参数
        /// </summary>
        /// <param name="paraName">参数名</param>
        /// <param name="newValue">参数新值</param>
        public ParaChangeItem(string paraName, object newValue)
        {
            this.ParaName = paraName;
            this.NewValue = newValue;
        }

        /// <summary>
        /// 构造函数-更新参数值
        /// </summary>
        /// <param name="paraName">参数名</param>
        /// <param name="newValue">参数新值</param>
        /// <param name="oldValue">参数旧值</param>
        public ParaChangeItem(string paraName, object newValue, object oldValue)
        {
            this.ParaName = paraName;
            this.NewValue = newValue;
            this.OldValue = oldValue;
        }


        /// <summary>
        /// 重写ToString
        /// </summary>
        /// <returns>String</returns>
        public override string ToString()
        {
            return $"({this.ParaName},{this.NewValue},{this.OldValue})";
        }

    }

}
